package io;

import java.io.FileOutputStream;
import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.util.Scanner;

/**
 * 简单记事本工具
 */
public class TestNote {
    public static void main(String[] args) throws IOException {
        Scanner scanner = new Scanner(System.in);
        FileOutputStream fos = new FileOutputStream("note.txt");
        System.out.println("来开始写东西吧");
        while (true){
            String s = scanner.nextLine();
            if ("exit".equals(s )){
                System.out.println("写完了,程序退出");
                break;
            }
           // byte[] data  = s.getBytes(StandardCharsets.UTF_8);
            fos.write(s.getBytes(StandardCharsets.UTF_8));
        }

        fos.close();

    }
}
